//
//  XMLParserWorkerArrayData.m
//  OR_1
//
//  Created by Luboš Kulič on 10/23/10.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import "XMLParserWorkerArrayData.h"


@implementation XMLParserWorkerArrayData

-(id) init {
	return [self initWithName:@"<<XMLParserWorkerArrayData_DummyName>>"];
}

-(id) initWithName:(NSString *) name {
	if(self = [super initWithName:name]) {
		subelements = [[NSMutableArray array] retain];		
	}
	return self;	
}

-(void) dealloc {
	[subelements dealloc];
	[super dealloc];
}


-(NSString *) description {
	return [NSString stringWithFormat:@"Array item, Name: %@\n%@\nWorker Subelements: %@", elementName, [super description], [subelements description]];
}


-(void) parserWillStartSubelement:(NSString *)elementName withWorker:(XMLParserWorker *)newWorker {
	NSLog(@"Adding sublement into array: %@", elementName);
	[subelements addObject:newWorker];
}

@end
